"""前台大堂点餐端子路由文件
"""
from django.urls import path,include
from .views import views,cart,orders

urlpatterns = [
    path('', views.index, name="index"),

    # 前台登录退出的路由
    path('login',views.login,name="web_login"),
    path('dologin',views.dologin,name="web_dologin"),
    path('logout',views.logout,name="web_logout"),
    path('verify',views.verify,name="web_verify"),

    # 为url路由添加请求前缀
    path("web/", include([
        path('', views.webindex, name="web_index"), # 前台大堂点餐首页
        # 购物车信息管理路由
        path('cart/add/<str:pid>', cart.add, name="web_cart_add"),  # 购物车添加
        path('cart/delete/<str:pid>', cart.delete, name="web_cart_delete"),  # 购物车删除
        path('cart/clear', cart.clear, name="web_cart_clear"),      # 购物车清空
        path('cart/change', cart.change, name="web_cart_change"),   # 购物车更改

        # 订单处理路由
        path('orders/<int:pindex>',orders.index,name="web_orders_index"),  # 订单浏览
        path('orders/insert',orders.insert,name="web_orders_insert"),    # 执行订单添加
        path('orders/detail',orders.detail,name="web_orders_detail"),    # 执行订单详情
        path('orders/status',orders.status,name="web_orders_status"),    # 执行订单修改

    ]))
]
